<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="/WEB-INF/tlds/spring.tld"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld"%>
<c:set var="BasePath" value="${pageContext.request.contextPath}"></c:set>
<c:set var="Plugins" value="${pageContext.request.contextPath}/res/plugins"></c:set>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商品出入库明细表</title>
<link href="${Plugins}/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="${Plugins}/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
<script src="${Plugins}/datepicker/WdatePicker.js" type="text/javascript"></script>
<script src="${Plugins}/jquery/jquery-1.4.4.min.js"	type="text/javascript"></script>
<script src="${Plugins}/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script src="${BasePath}/res/js/common/utils.js" type="text/javascript"></script>
<style type="text/css">
#searchbar{
	margin-bottom: 10px;
}
.navbar {
		height: 20px;
		border-bottom: #E6E6E6 solid 1px;
		line-height: 20px;
	}
.l-button-search{
	width: 50px;
	margin-left: 10px;
	padding-bottom: 2px;
	display: inline;
}
</style>
</head>
<body>
<div id="">
	<div class="navbar"><span>您当前的位置：商品管理 &gt;出入库明细导出列表 </span></div>
	<br/>
	<form action="#"  name="queryForm" id="queryForm" method="POST">
		出入库类型:<select id="moduleCode" name="moduleCode">
				    <option value=""  <c:if test="${inventoryChangeDetail.moduleCode == ''}">selected</c:if>>请选择</option>
				    <option value="0003"  <c:if test="${inventoryChangeDetail.moduleCode == '0003'}">selected</c:if>>采购入库</option>
				    <option value="0009"  <c:if test="${inventoryChangeDetail.moduleCode == '0009'}">selected</c:if>>采购退货出库</option> 
				    <option value="0001"  <c:if test="${inventoryChangeDetail.moduleCode == '0001'}">selected</c:if>>其他入库</option>
					<option value="0002"  <c:if test="${inventoryChangeDetail.moduleCode == '0002'}">selected</c:if>>其他出库</option>
				    <option value="0008"  <c:if test="${inventoryChangeDetail.moduleCode == '0008'}">selected</c:if>>销售退货入库</option>
					<option value="0007"  <c:if test="${inventoryChangeDetail.moduleCode == '0007'}">selected</c:if>>配货单出库</option>
				   </select>&nbsp;&nbsp;&nbsp;&nbsp;
		操作时间：<input id="operateStartTime" type="text" name="operateStartTime" readonly="readonly" value="${inventoryChangeDetail.operateStartTime }" class="Wdate" value="" size="21"
    	onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true,autoPickDate:true,maxDate:'#F{$dp.$D(\'operateEndTime\')||\'2020-10-01\'}'})" >~
    	<input id="operateEndTime" type="text" name="operateEndTime" readonly="readonly" value="${inventoryChangeDetail.operateEndTime }" class="Wdate" value="" size="21"
    	onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true,autoPickDate:true,minDate:'#F{$dp.$D(\'operateStartTime\')||\'2013-01-01\'}'})" >&nbsp;&nbsp;&nbsp;&nbsp;
    	<input type="submit" value="查询" class="l-button-search"  >&nbsp;&nbsp;&nbsp;&nbsp;<input  type="button" id="resetButton" value="重置" class="l-button-search" >
	</form>
	<br/>
</div>

<div id="maingrid6" style="margin:0; padding:0"></div>
  <div style="display:none;">
  <!-- g data total ttt -->
</div>
<script type="text/javascript">
	var basePath="${BasePath}";
    var grid = null;
    
    $(function () {
    	 // 重置
        $("#resetButton").click(function(){
        	$('#operateStartTime').val('');
        	$('#operateEndTime').val('');
        	$("select").find("option[value='']").attr("selected","true");  
    	});
    	 
        grid = $("#maingrid6").ligerGrid({
            columns: [
            { display: '出入库类型', name: 'operateType'},
            { display: '仓库编码', name: 'warehouseCode'},
            { display: '仓库名称', name: 'warehouseName'},
            { display: '商品分类', name: 'catName'},
            { display: '商品品牌', name: 'brandName'},
            { display: '货品编号', name: 'prodNo'},
            { display: '货品条码', name: 'prodBarCode'},
            { display: '商品名称', name: 'commoName'},
            { display: '商品规格', name: 'commoSpec'},            
            { display: '商品单位', name: 'prodUnit'},    
            { display: '销售类型', name: 'saleType'},
            { display: '税率(%)', name: 'prodRate'},
            { display: '数量', name: 'operateNum'},
            { display: '未税成本价', name: 'unCostPrice' },
            { display: '未税总成本', name: 'unCostAmount'},
            { display: '单位税金', name: 'unitTaxAmount'},
            { display: '总税金', name: 'totalTaxAmount'},
            { display: '含税成本价', name: 'costPrice'},
            { display: '含税总成本', name: 'costAmount'},
            { display: '出入库时间', name: 'operateTime'},
            { display: '单据来源号', name: 'sourceDocuments'},
            { display: '出入库单号', name: 'wmsNo'},
            { display: '出库对应入库单号', name: 'poChNo'},
            { display: '供应商名称', name: 'suppName'},
            { display: '制单人', name: 'makingUser' }
            ], 
            pageSize:30,
            width: '100%',
            height: '100%',
            columnWidth: '10%',
            dataType: 'server', 
            dataAction: 'server',
            pagesizeParmName: 'pageSize',
            parms: [
					{name: "moduleCode", value:encodeURI(encodeURI($('#moduleCode').val()))},
					{name: "operateStartTime", value:encodeURI(encodeURI($('#operateStartTime').val()))},
					{name: "operateEndTime", value:$("#operateEndTime").val()}
                    ],
            url: "list_inventory_change_detail.do",
            toolbar: {items: [
              	{text: '导出EXCEL', click: doExportExcel, icon: "print"}
            ]}
        });
    });
    
	function doExportExcel() {
		var moduleCode = encodeURI(encodeURI($('#moduleCode').val()));
		var operateStartTime = $('#operateStartTime').val();
		var operateEndTime = $('#operateEndTime').val();
		if(moduleCode==""){
			alert("请选择导出类型!");
			return;
		}
		var params = '?moduleCode=' + moduleCode + '&operateStartTime=' 
				+ operateStartTime + '&operateEndTime=' + operateEndTime;
		
		window.location.href = 'doExportExcel.do' + params;
	}
</script>
</body>
</html>